package com.zlp.pay.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.zlp.api.service.PaymentChannelService;
import com.zlp.common.base.BaseApiService;
import com.zlp.common.core.bean.BeanToUtils;
import com.zlp.mapper.MapperUtils;
import com.zlp.pay.entity.PaymentChannelEntity;
import com.zlp.pay.mapper.PaymentChannelMapper;
import com.zlp.pay.out.dto.PaymentChannelDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;


@RestController
public class PaymentChannelServiceImpl extends BaseApiService<List<PaymentChannelDTO>>
		implements PaymentChannelService {
	@Autowired
	private PaymentChannelMapper paymentChannelMapper;

	@Override
	public List<PaymentChannelDTO> selectAll() {
		List<PaymentChannelEntity> paymentChanneList = paymentChannelMapper.selectAll();
        List<PaymentChannelDTO> paymentChannelDTOList = new ArrayList<PaymentChannelDTO>();
        for (PaymentChannelEntity payment: paymentChanneList) {
            paymentChannelDTOList.add(BeanToUtils.doToDto(payment,PaymentChannelDTO.class));
        }
		return paymentChannelDTOList;
	}

}
